//
//  GameDataManager.m
//  CandyJump
//
//  Created by Bon Lam on 03/03/2011.
//  Copyright 2011 Peru Republic. All rights reserved.
//

#import "GameDataManager.h"

//=====================================================================================================================
@implementation MapData

@synthesize backgroundInfo;
@synthesize backgroundSceneArray;

@end

//=====================================================================================================================
@implementation GameDataManager

@synthesize mapData;
@synthesize currentCharacter;

static GameDataManager *sharedManager = nil;

#pragma mark -
#pragma mark Singleton Object Functions
//---------------------------------------------------------------------------------------------------------------------
- (id)init
{
	self = [super init];
	if (self == nil)  {return self;}
	
	return self;
}

//---------------------------------------------------------------------------------------------------------------------
- (void)dealloc
{
	[super dealloc];
}

//---------------------------------------------------------------------------------------------------------------------
+ (id)allocWithZone:(NSZone *)zone
{
    return [[self sharedManager] retain];
}

//---------------------------------------------------------------------------------------------------------------------
- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

//---------------------------------------------------------------------------------------------------------------------
- (id)retain 
{
    return self;
}

//---------------------------------------------------------------------------------------------------------------------
- (NSUInteger)retainCount
{
    return NSUIntegerMax;  //denotes an object that cannot be released
}

//---------------------------------------------------------------------------------------------------------------------
- (void)release
{
    //do nothing
}

//---------------------------------------------------------------------------------------------------------------------
- (id)autorelease
{
    return self;
}

#pragma mark Custom Functions
//---------------------------------------------------------------------------------------------------------------------
+ (GameDataManager *)sharedManager
{
	if (sharedManager == nil) {
        sharedManager = [[super allocWithZone:NULL] init];
    }
    return sharedManager;
}

@end
